package com.aeye.chatserver.dto;

import lombok.Data;

@Data
public class ResultDTO {

    private int code;
    private String msg;
    private Object data;

    public ResultDTO(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResultDTO() {
    }

    public static ResultDTO success(String msg, Object data) {
        return new ResultDTO(0, msg, data);
    }

    public static ResultDTO error(String msg, Object data) {
        return new ResultDTO(-1, msg, data);
    }
}
